xenstore: add explicit memory context parameter to read_node()
authorJuergen Gross <jgross@suse.com>
Tue, 19 Jul 2016 11:30:44 +0000 (13:30 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 19 Jul 2016 11:56:59 +0000 (12:56 +0100)
commitba81f6636f76511cae83425b1a2e4ade202810fb
treece6c0bfe29ac2754693015169eb9b4f13c5a5a4a
parentf304adbd5e1047b36fb64e98ad400fa17084b9cd
xenstore: add explicit memory context parameter to read_node()

Add a parameter to xenstored read_node() function to explicitly
specify the memory context to be used for allocations. This will make
it easier to avoid memory leaks by using a context which is freed
soon.

When calling read_node() select a sensible memory context for the new
parameter by preferring a temporary one.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenstore/xenstored_core.c